<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
    <script  type="text/javascript" src="https://cdn.bootcdn.net/ajax/libs/jquery/1.10.0/jquery.js"></script>
    <script>
        $(function () {
            var abc = function () {
                $("#div1").toggle(2000,abc);
            }
            abc();
        })

    </script>
</head>
<body>
        <div id="div1" style="text-align: center;background-color: aqua;height: 200px;width: 200px">

        </div>
</body>
</html>